/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * ReceiptRow.java
 *
 * Created on 2011-mar-10, 17:19:19
 */

package imat;

import javax.swing.JLabel;
import se.chalmers.ait.dat215.project.Product;

/**
 *
 * @author Boel_
 */
public class ReceiptRow extends javax.swing.JPanel {

    /** Creates new form ReceiptRow */
    public ReceiptRow() {
        initComponents();
    }

    public JLabel getReceiptRowAmountLabel() {
        return receiptRowAmountLabel;
    }

    public void setReceiptRowAmountLabel(double amount) {
        receiptRowAmountLabel.setText("Antal: "+amount);
    }

    public JLabel getReceiptRowNameLabel() {
        return receiptRowNameLabel;
    }

    public void setReceiptRowNameLabel(Product product) {
        receiptRowNameLabel.setText(product.getName());
    }

    public JLabel getReceiptRowPriceLabel() {
        return receiptRowPriceLabel;
    }

    public void setReceiptRowPriceLabel(double price) {
        receiptRowPriceLabel.setText("Pris: "+price+"kr");
    }



    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        receiptRowNameLabel = new javax.swing.JLabel();
        receiptRowAmountLabel = new javax.swing.JLabel();
        receiptRowPriceLabel = new javax.swing.JLabel();

        setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        setName("Form"); // NOI18N

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(imat.IMatApp.class).getContext().getResourceMap(ReceiptRow.class);
        receiptRowNameLabel.setText(resourceMap.getString("receiptRowNameLabel.text")); // NOI18N
        receiptRowNameLabel.setName("receiptRowNameLabel"); // NOI18N

        receiptRowAmountLabel.setText(resourceMap.getString("receiptRowAmountLabel.text")); // NOI18N
        receiptRowAmountLabel.setName("receiptRowAmountLabel"); // NOI18N

        receiptRowPriceLabel.setText(resourceMap.getString("receiptRowPriceLabel.text")); // NOI18N
        receiptRowPriceLabel.setName("receiptRowPriceLabel"); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(receiptRowNameLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(receiptRowAmountLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(receiptRowPriceLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(receiptRowPriceLabel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE, false)
                        .addComponent(receiptRowNameLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(receiptRowAmountLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel receiptRowAmountLabel;
    private javax.swing.JLabel receiptRowNameLabel;
    private javax.swing.JLabel receiptRowPriceLabel;
    // End of variables declaration//GEN-END:variables

}
